//
//  PortalMainActivityTiledHeaderView.m
//  lrlzapp
//
//  Created by dl on 16/2/29.
//  Copyright © 2016年 lrlz. All rights reserved.
//

#import "PortalMainActivityTiledHeaderView.h"

@implementation PortalMainActivityTiledHeaderView {
    UILabel *titleLabel;
}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];

        LLUIImageView *imageView = [LLUIImageView new];
        [imageView setImage:[UIImage imageNamed:@"portal_activity_tiled_star"]];
        [self addSubview:imageView];
        [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(SUIT_H(10));
            make.centerY.equalTo(self);
            make.width.height.mas_equalTo(SUIT_H(12));
        }];

        titleLabel = [UILabel new];
        titleLabel.textColor = UI_COLOR_FONT_BLACK;
        titleLabel.font = SUIT_FONT(13);
        [self addSubview:titleLabel];

        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.top.right.equalTo(self);
            make.left.equalTo(imageView.mas_right).offset(SUIT_W(5));
        }];
    }
    return self;
}

- (void)setModuleTitle:(NSString *)moduleTitle {
    if (_moduleTitle != moduleTitle) {
        _moduleTitle = moduleTitle;

        titleLabel.text = _moduleTitle;
    }
}

@end
